package com.itheima.controller;


import com.itheima.entity.Result;
import com.itheima.pojo.WebConfig;
import com.itheima.service.WebConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wangchang
 * @since 2020-08-04
 */
@RestController
@RequestMapping("/webConfig")
@CrossOrigin(allowCredentials="true", allowedHeaders="*", methods={RequestMethod.GET,RequestMethod.POST}, origins="*")
public class WebConfigController {

    @Autowired
    private WebConfigService webConfigService;
    @PostMapping("/editWebConfig")
    public Result editWebConfig(@RequestBody WebConfig webConfig){

        return webConfigService.editWebConfig(webConfig);
    }

    @GetMapping("/getWebConfig")
    public Result<WebConfig> getWebConfig(){

        return webConfigService.getWebConfig();
    }
}

